Integrating Video into Macromedia Flash
Table of Contents
Streaming Video
During this walkthrough, you will export video to create a FLV file, add a Media Playback component instance to a document, and select the FLV file to stream in the instance.
- Create a new Flash document.
-
Export video:
- Import cyclers.mov from the directory where you unzipped the files to the library.
- Double-click cyclers.mov in the library to view its Embedded Video Properties. Ensure that you click the movie icon and not the text, otherwise, you will rename the text.
- Select Export.
-
Use the Export FLV dialog box to save the exported file as cyclers.flv in the {webroot}.
Note: If you are using Microsoft Internet Information Server (IIS), the web root is typically, c:\inetpub\wwwroot.
- Click Save and OK.
-
Delete cyclers.mov in the library to maintain minimum document size.
-
Add a Video Playback component:
- Drag an instance of the MediaPlayback component from the Components panel to the Stage.
-
Use the Property inspector to define the component’s properties:
- Width: 190
- Height:130
- X: 139
-
Y: 132
-
Add video to the Video Playback component:
-
Select the component instance on the Stage and click Launch Component Inspector on the Parameters tab of the Property inspector.
Note: This automatically opens the Component Inspector panel in the docked panels.
- On the Component Inspector panel, select the FLV file type for the streaming media.
-
Enter http://localhost/cyclers.flv in the URL field to stream the cyclers.flv file from that location.
-
-
Save and test the application:
- Save and test the application.
- View the streaming video.
-
Choose View > Bandwidth profiler and note how much smaller the video file is.
-
Close the SWF and FLA
Summary
This article focuses on two ways of importing video into Flash:
- Embedding the video directly into a Flash document
- Using the media components.
The media components result in much smaller file sizes because the video is steamed down from a server; in addition they provide convenient user controls. To stream from a server, you must export the video as an FLV file from the Flash environment.
Embedding video into a Flash document is inherently more flexible because you can easily sync the video to animations or actions occurring on a Flash timeline. If you do embed video, it is a best practice to store the video in a separate MovieClip timeline because it allows you to more easily manipulate the video.